package com.itxiaoxiong.chat.mapper;

import com.itxiaoxiong.chat.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface LoginMapper {

    /*
        根据用户名和密码查询用户，进行登录操作
     */
    //select
    @Select("select * from user where username = #{username} and password = #{password}")
    User login(User user);


    /*
    退出登录
     */
//    @Update("update socket_map set deleted = 1 where key = #{id}")
//    void outLogin(@Param("id") String id);
    @Update("update  socket_map set deleted = 1 where `key` = #{idString}")
    void outLogin(String idString);
}
